home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10413 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: mother.usf.edu!grad!millert
  2. From: Timothy Miller <millert@csee.usf.edu>
  3. Newsgroups: gnu.g++.help,comp.lang.c++
  4. Subject: 3Q's:  stdio.h, unary minus, declaration/definition
  5. Date: Thu, 7 Mar 1996 14:52:15 -0500
  6. Organization: University of South Florida
  7. Message-ID: <Pine.SUN.3.91.960307143932.2763A-100000@grad>
  8. NNTP-Posting-Host: grad.csee.usf.edu
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=US-ASCII
  11. X-Sender: millert@grad
  12.  
  13. Should g++ have a stdio.h file?  The installation here didn't have one, 
  14. and when I complained about it, the admins completely reinstalled g++.  
  15. It was STILL missing stdio.h.  They told me that they FTP'd it twice and 
  16. were very careful about the installation, but it just doesn't have 
  17. stdio.h.  I need it for things like sscanf.
  18.  
  19. ---
  20.  
  21. If I have a member function that overloads the unary minus operator, is 
  22. the 'this' object the object that the minus is attached to, or is it a 
  23. temporary copy?
  24.  
  25. ---
  26.  
  27. I have Stroustrup's book on C++, and his use of the terms 'declaration' 
  28. and 'definition' are odd to me.
  29.  
  30. I was taught that a definition is something that simply describes the
  31. structure of something, such as a function prototype, a struct
  32. description, an extern statement, or or anything that doesn't create or
  33. state an actual object but refers to an actual object somewhere else or
  34. describes what something should look like. 
  35.  
  36. A declaration is where an actual instance of something is given or 
  37. created.  An actual function, a local or global variable statement, etc.
  38.  
  39. But Stroustrup seems to get them mixed up a bit.  He calls an extern a 
  40. declaration... but it's not declaring anything... it's simply defining 
  41. what the object elsewhere looks like.  He calls a statement that creates 
  42. an actual variable a definition, but you're not defining it, you're 
  43. declaring it to actually exist there.  With a few exceptions, 
  44. Stroustrup's book uses definition and declaration completely reverse of 
  45. what I was taught in school and by books on programming C that I have read.
  46.  
  47. Is he making a mistake or am I?
  48.  
  49. ---------------------------------------------------------------------------
  50. Timothy Miller, millert@grad.csee.usf.edu           Theoretical Linguistics
  51. http://www.csee.usf.edu/~millert         Music Theory, Computer Engineering
  52. ---------------------------------------------------------------------------
  53. Cunning linguists are very skilled with their tongues.
  54.  
  55.